app
.controller('formSelfCtrl', ['$scope', '$http', FormSelfController]);
function FormSelfController($scope, $http){
	$scope.changeValueMap = function(field) {
		var miBase = parseFloat($scope.valueMap['miBase']); // 医保基数
		var miRatioUnit = parseFloat($scope.valueMap['miRatioUnit']); // 医疗保险比例（单位）
		var miRatioIndividual = parseFloat($scope.valueMap['miRatioIndividual']); // 医疗保险比例（个人）
		if( (miBase || miBase==0 )
			&&  (miRatioUnit || miRatioUnit==0 )
			&& (miRatioIndividual || miRatioIndividual==0 )) {
			// 医疗保险（单位）/月
			var miUnitMoonth = (miBase * (miRatioUnit/100)).toFixed(2);
			$scope.valueMap['miUnitMoonth'] = miUnitMoonth;
			// 医疗保险（个人）/月
			var miIndividualMonth = (miBase * (miRatioIndividual/100)).toFixed(2);
			$scope.valueMap['miIndividualMonth'] = miIndividualMonth;

		}
	}
}

